package com.plian.system.wrapper.pm.annualdonationrecord;


import com.plian.system.dto.pm.annualdonationrecord.AnnualDonationRecordDTO;
import com.plian.system.entity.pm.annualdonationrecord.AnnualDonationRecord;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pm.annualdonationrecord.AnnualDonationRecordVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * 企业年度捐赠计划备案子表包装类,返回视图层所需的字段
 *
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface AnnualDonationRecordWrapper extends BaseWrapper<AnnualDonationRecord, AnnualDonationRecordDTO, AnnualDonationRecordVO> {

	/**
	 * Entity转VO
	 *
	 * @param entity /
	 * @return /
	 */
	@Override
	@Mappings(value = {
			@Mapping(source = "donationCompany", target = "donationCompanyName", qualifiedByName = PROPERTY_ID_NAME),
			@Mapping(source = "currencyId", target = "currencyName", qualifiedByName = DICT_CODE_TO_NAME)
	})
	AnnualDonationRecordVO entityToVO(AnnualDonationRecord entity);
}
